; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt %loadexampleirtransforms -passes=tut-simplifycfg -tut-simplifycfg-version=v1 -S < %s | FileCheck %s
; RUN: opt %loadexampleirtransforms -passes=tut-simplifycfg -tut-simplifycfg-version=v2 -S < %s | FileCheck %s
; RUN: opt %loadexampleirtransforms -passes=tut-simplifycfg -tut-simplifycfg-version=v3 -S < %s | FileCheck %s

define ptr @simp1(i32 %x) {
; CHECK-LABEL: @simp1(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[X:%.*]], 42
; CHECK-NEXT:    [[ADDR:%.*]] = select i1 [[CMP]], ptr inttoptr (i32 1 to ptr), ptr inttoptr (i32 1 to ptr)
; CHECK-NEXT:    ret ptr [[ADDR]]
;
entry:
  %cmp = icmp slt i32 %x, 42
  %addr = select i1 %cmp, ptr blockaddress(@simp1, %bb1), ptr blockaddress(@simp1, %bb2)
  ret ptr %addr

bb1:
  ret ptr null

bb2:
  ret ptr null
}
